# -*- coding: utf-8 -*-
#
# Author:: Jonny
# Date:: 2022/4/20
import os
from time import sleep

gravity_list = [
    "0,50,0",
    "0,-50,0",
    # "0,10,0",  # 左
    # "0,-10,0",  # 右
    # "10,30,0",  #
    # "10,-30,0",  #
    # "10,20,0",  #
    # "10,-20,0",  #
    # "10,10,0",  #
    # "10,-10,0",  #
    # "30,10,0",  #
    # "30,-10,0",  #
    # "20,10,0",  #
    # "20,-10,0",  #
    # "10,0,0",  #
    # "-10,0,0",  #
    # "",  #
    # "",  #
    # "",  #
]


def main():
    # 复位
    cmd_str_tmp = f"ldconsole action --name A --key call.gravity --value 0,0,0"
    print(cmd_str_tmp)
    os.popen(cmd_str_tmp)
    sleep(3)

    for gravity_data in gravity_list:
        if len(gravity_data) > 0:
            cmd_str_tmp = (
                f"ldconsole action --name A --key call.gravity --value {gravity_data}"
            )
            print(cmd_str_tmp)
            os.popen(cmd_str_tmp)
            sleep(1)


if __name__ == "__main__":
    main()
